import request from '@/utils/request'

/*
 * 职员管理
 */
/* 公司 */
// 获取下拉框公司列表及导出
export function getDepartmentList (query) {
  return request.get('/Home/Department/getDepartmentList', { params: query })
}
// 获取公司列表及导出
export function getDepartmentListForPage (query) {
  return request.get('/Home/Department/getDepartmentListForPage', { params: query })
}
// 添加公司
export function addDepartment (data) {
  return request.post('/Home/Department/addDepartment', data)
}

// 删除公司
export function delDepartment (data) {
  return request.post('/Home/Department/delDepartment', data)
}

// 获取公司是否关联
export function isUsedDepartment (query) {
  return request.get('/Home/Department/isUsedDepartment', { params: query })
}

// 获取公司详情
export function getDepartmentInfo (query) {
  return request.get('/Home/Department/getDepartmentInfo', { params: query })
}

/* 部门 */
// 获取下拉框部门列表及导出
export function getSectionList (params) {
  return request.get('/Home/Section/getSectionList', { params: params })
}
// 获取部门列表及导出
export function getSectionListForPage (params) {
  return request.get('/Home/Section/getSectionListForPage', { params: params })
}
// 添加部门
export function addSection (data) {
  return request.post('/Home/Section/addSection', data)
}

// 删除部门
export function delSection (data) {
  return request.post('/Home/Section/delSection', data)
}

// 获取部门是否关联
export function isUsedSection (query) {
  return request.get('/Home/Section/isUsedSection', { params: query })
}

// 获取部门详情
export function getSectionInfo (params) {
  return request.get('/Home/Section/getSectionInfo', { params: params })
}

/* 职级 */
// 获取下拉框职级列表及导出
export function getClassList (params) {
  return request.get('/Home/Class/getClassList', { params: params })
}
// 获取职级列表及导出
export function getClassListForPage (params) {
  return request.get('/Home/Class/getClassListForPage', { params: params })
}

// 获取职级详情
export function getClassInfo (params) {
  return request.get('/Home/Class/getClassInfo', { params: params })
}

// 添加职级
export function addClass (data) {
  return request.post('/Home/Class/addClass', data)
}

// 删除职级
export function DelClass (data) {
  return request.post('/Home/Class/DelClass', data)
}

// 获取职级是否关联
export function isUsedClass (query) {
  return request.get('/Home/Class/isUsedClass', { params: query })
}

/* 角色 */
// 获取下拉框角色列表及导出
export function getRoleList (params) {
  return request.get('/Home/Role/getRoleList', { params: params })
}
// 获取角色列表及导出
export function getRoleListForPage (params) {
  return request.get('/Home/Role/getRoleListForPage', { params: params })
}

// 添加角色
export function addRole (data) {
  return request.post('/Home/Role/addRole', data)
}

// 获取角色详情
export function getRoleInfo (params) {
  return request.get('/Home/Role/getRoleInfo', { params: params })
}

// 删除角色
export function delRole (data) {
  return request.post('/Home/Role/delRole', data)
}

// 获取角色是否关联
export function isUsedRole (query) {
  return request.get('/Home/Role/isUsedRole', { params: query })
}

/* 职员 */
// 获取下拉框职员及导出
export function getSaleList (params) {
  return request.get('/Home/Sale/getSaleList', { params: params })
}
// 获取职员及导出
export function getSaleListForPage (params) {
  return request.get('/Home/Sale/getSaleListForPage', { params: params })
}

// 获取总部职员列表（系统设置-审批设置）
export function getAdminDepartmentSaleList (params) {
  return request.get('/Home/Sale/getAdminDepartmentSaleList', { params: params })
}

// 添加职员
export function addSale (data) {
  return request.post('/Home/Sale/addSale', data)
}

// 删除职员
export function delSale (data) {
  return request.post('/Home/Sale/delSale', data)
}

// 获取职员详情
export function getSaleInfo (params) {
  return request.get('/Home/Sale/getSaleInfo', { params: params })
}

// 重置职员密码
export function resetPwd (data) {
  return request.post('/Home/Sale/resetPwd', data)
}
